

var follow_gps=null;
var update_interval=1000; var lat=0;
    var lon=0;
    var speed=0;
    var alt=0;
    var head=0;
    var map;
    
function getLocation() {
					navigator.geolocation.getCurrentPosition(setLocation, showError, {enableHighAccuracy:true,maximumAge:600000});
			}
 
			function showError(error) {
				alert(error.code + ' ' + error.message);
			}
 
			function setLocation(position) {
                            lat=position.coords.latitude;
                            lon=position.coords.longitude;
                            alt=position.coords.altitude;
                        //	alert(lat + ' ' + lon);
			    
			speed=position.coords.speed ;
			head= position.coords.heading ;
                         map.setCenter(new  google.maps.LatLng(lat, lon));
   
setTimeout('getLocation()',1000);
   		      
                    }
   setTimeout(    'getLocation()',1000);
                        
    // var osmMapType = new google.maps.ImageMapType({	getTileUrl: function(coord, zoom) {		return 'http://tile.openstreetmap.org/' +zoom + '/' + coord.x + '/' + coord.y + '.png';	},tileSize: new google.maps.Size(256, 256),isPng: true,alt: "OpenStreetMap layer",	name: "OpenStreetMap"});

function initialize() {         
    var latlng = new google.maps.LatLng(       lat,lon);           
    var myOptions = {                    zoom: 12,                     center: latlng,mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("map"),     myOptions);


google.maps.event.trigger(map, "resize");
}